home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / EEV100R1 / TESTP3.PAS < prev   
Pascal/Delphi Source File  |  1992-02-02  |  1KB  |  57 lines

  1. program TestP3;
  2.  
  3. { This is a simple test program I used for POSTFIX.INC (TURBO VERSION 3)}
  4.  
  5. {$I DFSTR.INC}
  6. {$I POSTFIX.INC}
  7.  
  8. var
  9.  
  10.   MyReal : real;
  11.   MyExpr : AnyStr;
  12.   MyErr,
  13.   MyBool : boolean;
  14.   MyAddr : Str20;
  15.  
  16. begin
  17.  
  18.   writeln('This program should give a result of 24');
  19.  
  20.   InitializeEE;
  21.  
  22.   {init test variables}
  23.   MyReal := 0;
  24.   MyErr := false;
  25.  
  26.   {add 2 and 2 and put the result (4) in FRED}
  27.   MyAddr := 'FRED';
  28.   MyExpr := '2 2 +';
  29.   CalcAndStore(MyExpr,MyAddr,MyErr);
  30.  
  31.   {multiply 3 by 7 and put the result (21) in WILMA}
  32.   MyAddr := 'WILMA';
  33.   MyExpr := '3 7 *';
  34.   CalcAndStore(MyExpr,MyAddr,MyErr);
  35.  
  36.   {add FRED (4) and WILMA (21), subtract 1 (24), and store in DINO}
  37.   MyAddr := 'DINO';
  38.   MyExpr := 'FRED WILMA + 1 -';
  39.   CalcAndStore(MyExpr,MyAddr,MyErr);
  40.  
  41.   {look in DINO}
  42.   ReadVariable(MyAddr,MyReal,MyBool);
  43.  
  44.   if MyBool then
  45.     MyReal := 0;
  46.  
  47.   {DINO has 24 in it here -- check for yourself using TD or writeln}
  48.  
  49.   writeln;
  50.   writeln('Answer = ',MyReal);
  51.   writeln;
  52.  
  53.   {deallocate linked list's memory}
  54.   DestroyList;
  55.  
  56. end. {TestI}
  57.